import request from '@/utils/request'

const api_name = '/admin/vod/teacher'

export default {
  // 讲师条件查询分页
  // current:当前页 limit:每页记录数 searchObj:条件对象
  pageList(pageNum, pageSize, searchObj) {
    return request({
      url: `${api_name}/page/${pageNum}/${pageSize}`,
      method: 'post',
      // 使用json格式传递，data:searchObj
      // 普通格式传递 params:searchObj
      data: searchObj
    })
  },

  removeTeacherId(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },

  saveTeacher(teacher) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: teacher
    })
  },

  getTeacherById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    })
  },

  updateTeacher(teacher) {
    return request({
      url: `${api_name}/update`,
      method: 'post',
      data: teacher
    })
  },

  batchRemove(ids) {
    return request({
      url: `${api_name}/removeBatch`,
      method: 'delete',
      data: ids
    })
  },
  // 所有讲师
  list() {
    return request({
      url: `${api_name}/findAll`,
      method: `get`
    })
  }
}
